function match=MatchPoint(C1,C2,centerLocation,angle)
    origin_locations=C1.Location;
    match_locations=C2.Location;
    move_locations(:,1)=origin_locations(:,1)-centerLocation(1);
    move_locations(:,2)=origin_locations(:,2)-centerLocation(2);
    size_locations=size(move_locations);
    size_locations2=size(match_locations);
    angle=deg2rad(angle);
    mul_mat=[cos(angle),sin(angle);-sin(angle),cos(angle)];
    for i=1:size_locations(1)
        move_locations(i,:)=move_locations(i,:)*mul_mat;
%         move_locations(i,1)=mul(1);
%         move_locations(i,1)=mul(2);
    end
%     move_locations=move_locations*[cos(angle),-sin(angle);sin(angle),cos(angle)];
    move_locations(:,1)=move_locations(:,1)+centerLocation(1);
    move_locations(:,2)=move_locations(:,2)+centerLocation(2);
    
%     size_locations2=size(match_locations);
    nums=0;
    for i=1:size_locations(1)
        check=false;
        for j=1:size_locations2(1)
            if((match_locations(j,1)-move_locations(i,1))<2&&(match_locations(j,2)-move_locations(i,2)<2))
                check=true;
                break
            end
        end
        nums=nums+check;
    end
%     for i=1:size_locations(1)
%         check=false;
%         change_location(:,1)=move_locations(:,1)-match_locations(i,1);
%         change_location(:,2)=move_locations(:,2)-match_locations(i,2);
%         for j=1:size_locations(1)
%             if(change_location(j,1)<2&&change_location(j,2)<2)
%                 check=true;
%                 break
%             end
%         end
%         nums=nums+check;
%     end
    match=nums/size_locations(1);
end

